package signal;

import org.webrtc.SessionDescription;

import java.util.concurrent.Future;
import java.util.function.Consumer;

import json_object_mapper.Trickle;

/**
 * The interface Signal.
 *
 * @author namvdo
 */
public interface Signal {
    /**
     * Join completable future.
     *
     * @param sid   the sid
     * @param uid   the uid
     * @param offer the offer
     * @return the completable future
     */
    Future<SessionDescription> join(String sid, String uid, SessionDescription offer);

    /**
     * Offer completable future.
     *
     * @param offer the offer
     * @return the completable future
     */
    Future<SessionDescription> offer(SessionDescription offer);

    /**
     * Answer.
     *
     * @param answer the answer
     */
    void answer(SessionDescription answer);

    /**
     * Trickle.
     *
     * @param trickle the trickle
     */
    void trickle(Trickle trickle);

    /**
     * Close.
     */
    void close();

    default void setOnNegotiate(Consumer<SessionDescription> sdp) {

    }

    default void setOnTrickle(Consumer<Trickle> trickle) {

    }



}
